import axios from "axios"

// eslint-disable-next-line 
export default {
    get: ({
        curPage, eachPage
    }) => {
      return axios.get('/api/seckill', {
        params: {
          curPage,
          eachPage
      }
      }).then(({
        data
      }) => data)
    },
    addDataToSever:(data)=>{
      return axios.post('/api/seckill/addseckill',data).then(({data})=>data)
    },

    changeState:(data)=>{
      console.log(":data",data);
      return axios.post('/api/seckill/changeState',data).then(({data})=>data)
    },
    updataSeckill:(data)=>{
      return axios.patch('/api/seckill/updataOne',data).then(({data})=>data)
    },
    selectSeckills:(data)=>{
      return axios.get('/api/seckill/selectSEckills',{params: data}).then(({data})=>data)
    },
    selectFromToType:(data)=>axios.get('/api/seckill/selectFromToType',{params: data}).then(({data})=>data),
    selectFromchildType:(data)=>axios.get('/api/seckill/selectFromchildType',{params: data}).then(({data})=>data),
    deleteSeckill:(data)=>axios.delete('/api/seckill/delSeckill',{params:data}).then(({data})=>data),

}


